package java_class_work.week01;

import java.util.Arrays;
import java.util.Scanner;

/**
 * @Author Tiam
 * @Date 2022/9/13 10:38
 * @Description: 数据加密
 */
public class Demo03 {

    public static void main(String[] args) {
        System.out.print("请输入一个6位数密码:");
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        System.out.println(method_1(num));
        System.out.println(method_2(num));
    }
    /**
     * 操作数字
     *
     * @param num
     */
    static int method_1(int num) {
        int code_num = 0;
        for (int i = 100000, j = 0; j < 6; j++, i /= 10, num /= 10) {
            int t = (num % 10 + 5) % 10;
            code_num += t * i;
        }
        return code_num;
    }

    static int method_2(int num) {

        return 0;
    }
}
